package games.hearthstone;

public class Card {

	private final int number;
	private final Rarity rarity;
	private final boolean golden;

	public Card(int number, Rarity rarity, boolean golden) {
		super();
		this.number = number;
		this.rarity = rarity;
		this.golden = golden;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + number;
		result = prime * result + ((rarity == null) ? 0 : rarity.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		Card other = (Card) obj;
		if (number != other.number) {
			return false;
		}
		if (rarity != other.rarity) {
			return false;
		}
		return true;
	}

	public int getNumber() {
		return number;
	}

	public Rarity getRarity() {
		return rarity;
	}

	public boolean isGolden() {
		return golden;
	}
}
